package com.example.satoken.common.exception;


import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 业务异常类，继承运行时异常，确保事务正常回滚
 *
 * @author WPZ
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class BaseException extends RuntimeException {

    private GlobalsCustomExceptionMessage code;

    public BaseException(int code, String msg) {
        this.code = new GlobalsCustomExceptionMessage(code, msg);
    }

    public BaseException(String msg) {
        this.code = new GlobalsCustomExceptionMessage(msg);
    }

    public BaseException() {
        this.code = new GlobalsCustomExceptionMessage();
    }

    public BaseException(Throwable cause, GlobalsCustomExceptionMessage code) {
        super(cause);
        this.code = code;
    }
}
